{% extends "static/view/template.html" %}
{% block body %}
<div class="container">

	<div class="page-header">
	</div>

	<div class="page-header">
        <h1> <font color= #333333><center>Bash</center></font>
			<small><center><font color= #778899>An online bash shell</font></center></small>
		</h1>
	</div>

</div>

<link href="http://terminal.jcubic.pl/css/jquery.terminal.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="http://terminal.jcubic.pl/js/jquery.terminal-min.js"></script>
 <div id="term_demo"></div>
    <script>
    jQuery(function($, undefined) {
    $('#term_demo').terminal(function(command, term) {
        if (command !== '') {
	    var xmlHttp = new XMLHttpRequest();
    	    xmlHttp.open( "GET", "/api/bash?command="+encodeURIComponent(command), false ); // false for synchronous request
            xmlHttp.send( null );
            var result = xmlHttp.responseText; 
            term.echo(String(result));
        }
    }, {
        greetings: 'rDSN Remote Interface',
        name: 'js_demo',
        prompt: 'Bash> '});
});
    </script>
{% endblock %}
